<template>
    <div>
        <LangHeaderS :styleColor="1" />
        <div class="page-content">
            <div class="main-wrap">
                <div :class="$store.getters.screenWidth > 1000 ? 'bread-crumb-box' : 'h5s'">
                    <div class="width-1360">
                        <img src="@/assets/img/home.png" class="home-icon">
                        <span>{{ $t('h.currentLoc') }}：</span>
                        <span>
                            <router-link to="/lang-index">&nbsp;{{ $t('h.home') }}</router-link>
                            <img src="@/assets/img/right.png" class="left-icon">
                        </span>
                        <span>
                            <span class="now">Xi'an Metro</span>
                        </span>
                    </div>
                </div>
                <div class="waper">
                    <div class="title">{{ $t('h.TrInfo') }}</div>
                    <div class="text"> {{ $t('h.trInfoText1') }}</div>
                    <div class="text"> {{ $t('h.trInfoText2') }} </div><img src="@/assets/img/map.png" alt="" srcset=""
                        class="img">
                    <div class="download" @click="downloadImage"><i class="el-icon-zoom-in"></i>{{ $t('h.downLoad') }}
                    </div>
                </div>
            </div>
        </div>
        <LangFooterS />
    </div>
</template>
<script>
import imageUrl from '@/assets/img/map.png';
import LangHeaderS from '@/components/Lang-Header.vue'
import LangFooterS from '@/components/Lang-Footer.vue'
export default ({
    components: {
        LangHeaderS,
        LangFooterS
    },
    data() {
        return {
            info: {},
            Img:imageUrl
          
        }
    },
    created() {
        // window.scrollTo({ top: 0, behavior: 'smooth' });
    },
    methods: {
        downloadImage() {
            var image = new Image();
            image.setAttribute("crossOrigin", "anonymous");
            var _this = this;
            image.onload = function () {
                var canvas = document.createElement("canvas");
                canvas.width = image.width;
                canvas.height = image.height;
                var context = canvas.getContext("2d");
                context.drawImage(image, 0, 0, image.width, image.height);
                var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据
                console.log(url);
                var a = document.createElement("a"); // 生成一个a元素
                var event = new MouseEvent("click"); // 创建一个单击事件
                a.download = _this.projectName || "xian-metro"; // 设置图片名称
                a.href = url; // 将生成的URL设置为a.href属性
                a.dispatchEvent(event); // 触发a的单击事件
            };
            image.src = this.Img;
        },
    }
})
</script>
<style lang="scss" scoped>
.page-content {
    width: 100%;
    background-color: #f5f5f5;
    padding-bottom: 5.20833vw;
}

.main-wrap .main .content {
    padding: 4.16667vw 3.125vw;
}

.bread-crumb-box {
    ::v-deep span {
        a:hover {
            color: #e31c1c;
        }
    }
}

.main-wrap .main .summary-wrap {
    height: 0.72917vw;
    font-size: 0.72917vw;
    line-height: 0.72917vw;
    color: #999;
    text-align: center;
}

.main-wrap .main .summary-wrap span {
    margin: 0 0.52083vw;
}

.main-wrap .main .line {
    width: 66.66667vw;
    height: 1px;
    background-color: #eeeeee;
    margin: 1.82292vw auto 2.08333vw;
}

.main-wrap .main .title {
    height: 1.61458vw;
    font-size: 1.5625vw;
    font-weight: 700;
    line-height: 1.61458vw;
    color: #333;
    margin: 0 0 1.77083vw;
    text-align: center;
}

.bread-crumb-box {
    padding: 2.60417vw 0 3.125vw;
}

.main-wrap .main {
    width: 70.83333vw;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
}

.bread-crumb-box .width-1360 {
    display: -webkit-box;
    display: flex;
    -webkit-box-align: center;
    align-items: center;
}

.width-1360 {
    width: 70.83333vw;
    margin: 0 auto;
}

.main-wrap {
    padding-top: 3.64583vw;
}

.bread-crumb-box .home-icon {
    width: 0.88542vw;
    line-height: 1;
    color: #999;
    margin-right: 0.52083vw;
    display: inline-block;
    vertical-align: middle;
}

.bread-crumb-box span {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.72917vw;
    font-weight: 400;
    color: #666;
    line-height: 0.9375vw;
}

.bread-crumb-box span a {
    color: #666;
}

.bread-crumb-box .left-icon {
    color: #666;
    margin: 0 0.52083vw;
    display: inline-block;
    vertical-align: middle;
}

.bread-crumb-box span:nth-last-of-type(1) {
    color: #333;
}

.bread-crumb-box span .now {
    color: #e31c1c
}

.waper {
    width: 70.83333vw;
    background-color: #fff;
    margin: 0 auto;
    padding: 4.16667vw 3.125vw;
}

.waper .title {
    font-family: TimesNewRomanPS-BoldMT;
    font-size: 1.875vw;
    font-weight: normal;
    font-stretch: normal;
    line-height: 2.5vw;
    letter-spacing: 0px;
    color: #666666;
}

.waper .text {
    margin-top: 2.08333vw;
    font-family: TimesNewRomanPSMT;
    font-size: 1.04167vw;
    font-weight: normal;
    font-stretch: normal;
    line-height: 1.5625vw;
    letter-spacing: 0px;
    color: #666666;
}

.waper .img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.waper .download {
    cursor: pointer;
    margin: 0 auto;
    text-align: center;
    margin-top: 3.125vw;
    font-size: 1.04167vw;
    font-weight: normal;
    font-stretch: normal;
    line-height: 1.5625vw;
    letter-spacing: 0px;
    color: #0000ee;
}

.waper .download .icon {
    font-size: 1.25vw;
    margin-right: 0.52083vw;
}

@media(max-width:1000px) {
    .main {
        padding-top: 0;
    }

    .h5s-content {
        min-height: -webkit-calc(100vh - 6rem);
        min-height: calc(100vh - 6rem);
    }

    .h5s {
        font-size: 0;
        padding: 0.5rem 0;
    }

    .h5s .width-1360 {
        width: 100%;
        padding: 0 0.3rem;
        font-size: 0.2rem;
        color: #666;
        display: -webkit-box;
        display: flex;
        -webkit-box-align: center;
        align-items: center;
    }

    .h5s .width-1360 .home-icon {
        width: 0.22rem;
        margin-right: 0.1rem;
    }

    .h5s .width-1360 a {
        color: #666;
    }

    .h5s .width-1360 .left-icon {
        margin: 0 0.1rem;
    }

    .h5s span .now {
        color: #e31c1c
    }

    .main-wrap {
        padding-top: 0;
    }

    .main-wrap .main {
        width: 100%;
        padding: 0 0.3rem;
        margin: 0 auto;
        background: #fff;
        overflow: hidden;
    }

    .main-wrap .main .title {
        font-size: 0.4rem;
        font-weight: 700;
        color: #333;
        margin: 0 0 0.3rem;
        text-align: center;
        height: auto;
        line-height: normal;
    }

    .main-wrap .main .summary-wrap {
        font-size: 0;
    }

    .main-wrap .main .line {
        width: 100%;
        height: 0.01rem;
        background-color: #eee;
        margin: 0.3rem auto 0.4rem;
    }

    .content {
        font-size: 0.2rem;
    }
}
</style>